<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags-->
    <!-- Title-->
    <title>我的历程 -健身猫</title>
    <!-- Favicon-->
    <link rel="icon" href="img/core-img/favicon.ico">
    <!-- Core Stylesheet-->
    <link rel="stylesheet" href="/css/bmr/style1.css" />
    <link rel="stylesheet" href="/css/bmr/style.css" />
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">


<body>
<!-- Preloader-->
<div class="preloader" id="preloader">
    <div class="spinner-grow text-secondary" role="status">
        <div class="sr-only">Loading...</div></div>
</div>

<div class="page-content-wrapper">
    <div class="container">
        <!-- Profile Wrapper-->
        <div class="profile-wrapper-area py-3">
            <!-- User Information-->
            <div class="card user-info-card">
                <div class="card-body p-4 d-flex align-items-center">
                    <div class="user-profile mr-3">
                        <img src="/img/face_wlcat.png" alt="" />
                        {{--<div class="change-user-thumb">--}}
                        {{--<form>--}}
                        {{--<input class="form-control-file" type="file" />--}}
                        {{--<button><i class="lni-pencil"></i></button>--}}
                        {{--</form>--}}
                        {{--</div>--}}
                    </div>
                    <div class="user-info">
                        <p class="mb-0 text-white">健身猫</p>
                        <h5 class="mb-0">每天营养-配置中心</h5>
                    </div>
                </div>
            </div>
        </div>
        </div>
        <!-- Add To Cart-->
        <div class="cart-form-wrapper bg-white mb-3 py-3">
            <div class="container">
                <form class="cart-form" action="#" method="post">
                    <div class="iDate date">
                        <input type="text" name="date" class="date">
                        <button type="button" class="addOn"></button>
                    </div>　
                    <button class="btn btn-warning" type="button" onclick="window.location.href='{{ url('/food', ['date'=>$date]) }}'">+ 食物</button>　
                </form>
            </div>
        </div>
        <!-- Product Specification-->
        <div class="p-specification bg-white mb-3 py-3">
            <div class="container">
                <h6><i class="fa fa-clock-o"></i> 待补充营养：</h6>
                <p>瞄~，今天总补充<span class="bg-success" style="color: white"> {{ $info->totalHot ?? 0  }} </span>热量，根据食物篮子的营养量，您的营养情况如下 ^_^</p>
                <ul>
                    <li>蛋白质 @if($rest['protein'] > 0) 欠 @else 超标 @endif：{{ number_format($rest['protein'], 2)  }}</li>
                    <li>脂肪 @if($rest['fat'] > 0) 欠 @else <span class="bg-danger" style="color: #fff">超标</span> @endif：{{ number_format(abs($rest['fat']), 2) }}</li>
                    <li>碳水化合物 @if($rest['carbohydrate'] > 0) 欠 @else 超标 @endif：{{ number_format($rest['carbohydrate'], 2) }}</li></ul>
            </div>
        </div>
        <!-- Rating & Review Wrapper-->
        <div class="rating-and-review-wrapper bg-white py-3 mb-3">
            <div class="container">
                <h6>食物篮子</h6>
                <div class="rating-review-content">
                    <ul>
                        @foreach($foods as $food)
                        <li class="single-user-review d-flex">
                            <div class="user-thumbnail">
                                <img src="/img/food.png" alt=""></div>
                            <div class="rating-comment">
                                <p class="comment mb-0">{{ $food->food_category }}</p>
                                <span class="name-date">数量：{{ $food->food_weight  }}克</span>
                                <span class="name-date">热量: 蛋白质：{{$food->food_protein}}，脂肪：{{$food->food_fat}}，碳水化合物：{{$food->food_carbohydrate}}</span>
                            </div>
                        </li>
                        @endforeach
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Footer Nav-->
<div class="footer-nav-area" id="footerNav">
    <div class="suha-footer-nav h-100">
        <ul class="h-100 d-flex align-items-center justify-content-between">
            <li>
                <a href="/calculate/count">
                    <img src="img/core-img/home.svg" alt="">首页</a></li>
            <li>
                <a href="/logout">
                    <img src="img/core-img/chat.svg" alt="">退出</a></li>
            <li>
                <a href="/calculate/count">
                    <img src="img/core-img/shopping-cart.svg" alt="">评测</a></li>
            <li>
                <a href="/date/{{ isset($date) ? $date : date('Y-m-d') }}">
                    <img src="img/core-img/heart.svg" alt="">营养表</a></li>
            <li>
                <a href="/food/{{ isset($date) ? $date : date('Y-m-d') }}">
                    <img src="img/core-img/settings.svg" alt="">+食物</a></li>
        </ul>
    </div>
</div>
<!-- All JavaScript Files-->
<script src="/js/jquery.min.js"></script>
<script src="/js/popper.min.js"></script>
<script src="/js/bootstrap4.4.min.js"></script>
<script src="/js/waypoint1.6.min.js"></script>
<script src="/js/jquery.easing.min.js"></script>
<script src="/js/owl.carousel.min.js"></script>
<script src="/js/imagesloaded.pkgd.min.js"></script>
<script src="/js/isotope.pkgd.min.js"></script>
<script src="/js/jquery.magnific-popup.min.js"></script>
<script src="/js/jquery.animatedheadline.min.js"></script>
<script src="/js/jquery.counterup.min.js"></script>
<script src="/js/wow.min.js"></script>
<script src="/js/jarallax.min.js"></script>
<script src="/js/jarallax-video.min.js"></script>
<script src="/js/jquery.passwordstrength.js"></script>
<script src="/js/bmr/active.js"></script>
<script src="/js/moment.js"></script>
<script src="/js/bootstrap-datetimepicker.js"></script>
<script src="/js/date.js"></script>

</body>

</html>
<script>
    $(document).ready(function(){
        var url = '{{ url('/date') }}';
        if($(".iDate.date").length>0){
            $(".iDate.date").datetimepicker({
                defaultDate: '{{ $date }}',
                locale:"zh-cn",
                format:"YYYY-MM-DD",
                dayViewHeaderFormat:"YYYY年 MMMM"
            }).on("dp.hide", function (e) {
                var temp =  new Date(e.date).format("Y-m-d");
                window.location.href=url + '/' +temp;
            });
        }
    })
</script>
